//
//  NSString+LG.m
//  ALS3.0
//
//  Created by guomianxiang on 2017/4/6.
//  Copyright © 2017年 guomianxiang. All rights reserved.
//

#import "NSString+LG.h"

@implementation NSString (LG)
- (NSString *)stringTransformPinYin {
    NSString *temp = [self stringByReplacingOccurrencesOfString:@" " withString:@"lg_replace"];
    
    NSMutableString *str = [temp mutableCopy];
    
    CFStringTransform(( CFMutableStringRef)str, NULL, kCFStringTransformMandarinLatin, NO);
    CFStringTransform((CFMutableStringRef)str, NULL, kCFStringTransformStripDiacritics, NO);
    
    temp = [str stringByReplacingOccurrencesOfString:@" " withString:@""];
    temp = [temp stringByReplacingOccurrencesOfString:@"lg_replace" withString:@" "];
    temp = [temp lowercaseStringWithLocale:[NSLocale currentLocale]];
    return temp;
}


@end
